Skip to main content

How Retry Logic Works

When a decorated method throws an error:

  1. The decorator catches the error
  2. shouldRetry(error) decides whether the retry is allowed
  3. A delay is applied
  4. The method is executed again
  5. This repeats until attempts are exhausted

If all attempts fail, the original error is rethrown.

Rebound supports:

  • Fixed delays
  • Exponential backoff
  • Conditional retries
  • Logging callbacks